package com.control.qct.businesssteward.adapter;

import android.support.annotation.Nullable;

import com.control.qct.businesssteward.R;
import com.control.qct.businesssteward.model.InventoryStatisticModel;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

/**
 * Created by Administrator on 2017/12/28 0028.
 */

public class InventoryStatisticTableAdapter extends BaseQuickAdapter<InventoryStatisticModel, BaseViewHolder> {
    private int max1;
    private int max2;

    public InventoryStatisticTableAdapter(@Nullable List<InventoryStatisticModel> data) {
        super(R.layout.rv_inventory_statistic_table_item, data);
    }

    @Override
    protected void convert(BaseViewHolder holder, InventoryStatisticModel item) {
        holder.setProgress(R.id.pb_stockout_statistic, item.getNum1(), max1).setProgress(R.id.pb_excess_statistic, item
                .getNum2(), max2).setText(R.id.tv_goods_type_name, item.getName());
    }

    public void setProgressMax(int max1,int max2) {
        this.max1 = max1;
        this.max2 = max2;
        notifyDataSetChanged();
    }
}
